package cn.anecansaitin.firecrafting.common.util;

import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;

import javax.annotation.Nonnull;
import java.util.List;

public class ModItemHandlerHelper {
    //存入多种物品
    public static boolean insertItem(IItemHandler dest, @Nonnull List<ItemStack> itemStacks, boolean simulate) {
        for (ItemStack itemStack : itemStacks) {
            ItemStack stack = ItemHandlerHelper.insertItem(dest, itemStack, simulate);
            if (!stack.isEmpty()) {
                return false;
            }
        }
        return true;
    }
}
